home *** CD-ROM | disk | FTP | other *** search
/ InfoMagic Internet Tools 1993 July / Internet Tools.iso / RockRidge / mail / smail-3.1.28 / guide / admin / install < prev    next >
Encoding:
Text File  |  1990-10-23  |  21.4 KB  |  655 lines

  1. .\" @(#)guide/admin/install    1.2 10/24/90 05:17:51
  2. .NH
  3. Smail Installation Procedure
  4. .PP
  5. The basic procedures for installing the
  6. .B Smail3.1
  7. program and its associated utilities require that you edit a small
  8. number of compile-time configuration files, build dependencies within
  9. all of the smail makefiles, and then build all of the executables and
  10. install them.  Some sites will wish to include the additional step of
  11. writing run-time configuration files, which are described in a later
  12. section.
  13. .NH 2
  14. The Source Release
  15. .PP
  16. When you receive a smail source release and install the sources under
  17. a directory, the following tree should exist:
  18. .RS
  19. .iP README
  20. A plain text file describing the release and general installation
  21. procedures and giving the addresses of useful mailing lists.
  22. .iP compat/
  23. A directory in which a compatibility library is generated containing
  24. functions that do not exist in your system's object libraries.
  25. .iP conf/
  26. A directory containing compile-time configuration files.
  27. .RS
  28. .iP EDITME-dist
  29. A file that should be copied and edited to describe your machine and
  30. the locations in which various files can be found or should be
  31. installed.
  32. .iP arch/
  33. A directory which contains files describing various machine
  34. architectures, such as 32-bit architectures with and without virtual
  35. memory, or 16 bit architectures with extended address spaces.
  36. .iP driver/
  37. A directory which contains files describing various possible driver
  38. configurations.  These files define specifically which director,
  39. router and transport drivers are to be included in the smail binary.
  40. .iP os/
  41. A directory which contains files describing various operating systems
  42. to which smail has been ported.  To as large an extent as is
  43. reasonable, operating system dependencies are described solely within
  44. these files.
  45. .iP lib/
  46. This directory contains shell commands and miscellaneous files used
  47. from smail makefiles to digest configuration information and build
  48. dependencies.
  49. .RE
  50. .iP guide/
  51. A directory containing the source for the various smail guide
  52. documents.
  53. .RS
  54. .iP admin/
  55. This directory contains the troff source for the
  56. .I "Smail Administration and Installation Guide" .
  57. .RE
  58. .iP history
  59. A file describing the history of smail releases, in terms of source
  60. reorganizations and the addition of new capabilities.
  61. .iP man/
  62. A directory containing nroff sources for all man pages included in the
  63. .B smail3.1
  64. release.
  65. .RS
  66. .iP man1/
  67. Man pages for user commands.
  68. .iP man5/
  69. Man pages describing run-time configuration file formats.
  70. .iP man8/
  71. Man pages for administrative commands and other programs that are not
  72. intended to be run directly by users.
  73. .RE
  74. .iP pd/
  75. A directory containing public domain sources that are used by the
  76. smail program or its associated utilities.
  77. .RS
  78. .iP binmail/
  79. A replacement for
  80. .I /bin/mail
  81. that traps mailer requests and sends them to smail.  This is for use
  82. by generic System V sites, and for other sites that are not already
  83. setup to call a mailer program.  This is not normally installed.
  84. .iP getopt/
  85. A public domain release of the System V
  86. .B getopt
  87. library function.  Also included is a getopt command which implements
  88. a super-set of the System V
  89. .I getopt (1)
  90. command.
  91. .iP pathalias/
  92. The
  93. .B pathalias
  94. program by Steve Bellovin, as told to Peter Honeyman with additional
  95. modifications suggested by Landon Noll.  These sources will be used as
  96. a basis for pathalias version 10.
  97. .iP strlib/
  98. An implementation of various string routines.  These will be used for
  99. systems that do not already have these routines in an object library.
  100. .iP uuwho/
  101. A program for viewing map entries distributed through USENET in the
  102. newsgroup
  103. .B comp.mail.maps .
  104. .RE
  105. .iP src/
  106. The source for the smail program.
  107. .RS
  108. .iP directors/
  109. The sources for all director drivers distributed with smail.  Director
  110. drivers handle the low level operations involved with aliasing,
  111. forwarding and the recognition of local user names.
  112. .iP routers/
  113. The sources for all routing drivers.  Routing drivers handle the low
  114. level operations of finding routes to hosts or domains and binding
  115. remote addresses to specific transports.
  116. .iP transports/
  117. The sources for all transport drivers.  Transport drivers perform the
  118. low level operations of mail delivery.
  119. .RE
  120. .iP util/
  121. The sources for various user and administrative utilities distributed
  122. with smail.
  123. .RE
  124. .NH 2
  125. Configuring Smail for Your System
  126. .PP
  127. The first step in configuring smail is to copy the file
  128. .I EDITME-dist ,
  129. in the source directory
  130. .I conf ,
  131. to the file
  132. .I EDITME
  133. in the same directory.  As the name implies, you should then edit this
  134. file to describe your machine.  This file is a shell script that is
  135. used to define variables such as what type of operating system you are
  136. using, the general class of architecture, and where particular data
  137. files and executables should reside.  It is also used to describe,
  138. within a limited range, the default configuration to be used when the
  139. optional runtime configuration files do not exist.
  140. .PP
  141. The
  142. .I EDITME
  143. file itself contains descriptions of all of the variables that can be
  144. defined in this file.  We will not attempt to duplicate all of the
  145. information here, though a few pointers may be useful.
  146. .NH 3
  147. Defining your Operating System
  148. .PP
  149. The variable OS_TYPE defines the basename of a file which should
  150. describe your operating system.  Possible values for OS_TYPE are the
  151. names of files in the directory
  152. .I conf/os .
  153. If none of these files accurately describe your system, then a new
  154. file should be created by copying the file
  155. .I template
  156. to a new name and editing it as appropriate.
  157. .PP
  158. If you port Smail to a new machine, we would appreciate receiving any
  159. patches that were required as well as the os file describing that
  160. machine.  Any reasonable contributions may be included in future
  161. releases.
  162. .NH 3
  163. Defining your Hostnames
  164. .PP
  165. There are a number of variables used to describe names for your
  166. machine.  Usually, most of these variables will be left undefined,
  167. forcing smail to compute the names itself.  Some variables that you
  168. may wish to change describe the domain namespaces in which your
  169. machine resides.  Gateway hosts will often require more hostname
  170. information so that they can handle mail sent to the domains that they
  171. handle, rather than to a specific host within them.
  172. .PP
  173. The most important variable to set is DOMAINS which describes the
  174. domains under which your host resides.
  175. .B Smail3.1
  176. will use a system-dependent algorithm for determining the name for the
  177. local host, such as the
  178. .I gethostname (2)
  179. system call in a BSD operating system, or
  180. .I uname (2)
  181. under System V.  The value of DOMAINS, in combination with the computed
  182. value for your machine's name, is used to form a list of fully
  183. qualified names for your host.  For many sites in the UUCP zone,
  184. DOMAINS should simply be set to ``uucp'', while domain gateways may
  185. need to use multiple values, separated by colons, such as
  186. ``uts.amdahl.com:amdahl.com:uucp''.  The first domain name in this
  187. list is special in that it is used in forming the primary (or
  188. .I canonical )
  189. name for your machine.  This name should be unique across all
  190. accessible networks.
  191. .PP
  192. To understand the use of the DOMAINS variable, let's use the value
  193. that is used for the gateway machine to the domain
  194. .B amdahl.com .
  195. The machine name for this gateway is
  196. .B amdahl .
  197. Its value for DOMAINS is ``uts.amdahl.com:amdahl.com:uucp''.  With
  198. this configuration, the primary name for the gateway is
  199. .B amdahl.uts.amdahl.com
  200. with other names being
  201. .B amdahl.amdahl.com
  202. and
  203. .B amdahl.uucp.
  204. .PP
  205. Additional names can be given to your machine, unrelated to the name
  206. smail computes for your host.  This can be useful for gateways that
  207. wish to be recognized under the names of domains for which they are a
  208. gateway.  The variable GATEWAY_NAMES should be set to this
  209. colon-separated list of alternate hostnames.  As an example, the
  210. gateway host ``amdahl'' sets GATEWAY_NAMES to
  211. ``uts.amdahl.com:amdahl.com''.  Thus, an address such as
  212. .B Postmaster@amdahl.com
  213. or
  214. .B Postmaster@uts.amdahl.com
  215. will reach a responsible person rather than being rejected.
  216. .PP
  217. As a final note on defining host names, the variable VISIBLE_NAME can
  218. be used to define the host name used in addresses referring to the
  219. local host.  This name will be used by in contexts where the
  220. canonical name is not required by DDN standards and can be used to
  221. group a collection of machines under a domain.  When resolving
  222. addresses, the VISIBLE_NAME string is not matched as a local hostname
  223. unless it also appears in either HOSTNAMES or GATEWAY_NAMES.
  224. .PP
  225. For example, most suns within the
  226. .B uts.amdahl.com
  227. domain set VISIBLE_NAME to ``uts.amdahl.com''.  Mail originating from
  228. .B chongo
  229. on a Sun named
  230. .B eek
  231. would appear to have been sent from
  232. .B chongo@uts.amdahl.com ,
  233. rather than from
  234. .B chongo@eek.uts.amdahl.com .
  235. The domain gateway knows where the user
  236. .B chongo
  237. wishes to receive his mail.  Thus, replies to mail sent from
  238. .B eek
  239. will be returned directly to
  240. .B chongo 's
  241. mailbox rather than passing back through
  242. .B eek .
  243. .NH 3
  244. Directories for Data Files and Executables
  245. .PP
  246. As distributed, programs intended to be run by users will be installed
  247. under the directory
  248. .I /usr/local ,
  249. while programs intended to be run only from cron jobs or from other
  250. smail programs will be installed under
  251. .I /usr/lib/smail .
  252. Configuration files will also be searched for under
  253. .I /usr/lib/smail .
  254. In addition, spool and log files will be placed in a hierarchy under
  255. .I /usr/spool/smail .
  256. These locations can be changed by setting the variables SMAIL_BIN_DIR,
  257. LIB_DIR and SPOOL_DIRS .
  258. .PP
  259. As the name implies, SPOOL_DIRS can contain more than one directory
  260. name.  This can be used to define multiple spool directory
  261. hierarchies.  When a new message comes in, an attempt is made to write
  262. it into the first hierarchy in this list.  If the file cannot be
  263. written, the next hierarchy is tried, then the next and so on until
  264. the spool file is written or no more directory names exist in the
  265. list.  For example, with a value of
  266. ``/usr/spool/smail:/usr2/spool/smail,'' if the filesystem containing
  267. .I /usr/spool/smail
  268. fills up or runs out of
  269. .I I -nodes,
  270. an attempt is made to write a spool file under
  271. .I /usr2/spool/smail
  272. instead.  Only if this second filesystem is also filled up will smail
  273. give up in trying to spool the message.
  274. .PP
  275. Some other path    names that you may wish to change are:
  276. .iP SMAIL_NAME
  277. the pathname used by smail utilities in executing the mailer.
  278. Normally, this will be
  279. .I /usr/lib/sendmail
  280. which is where Berkeley commands and utilities expect the mailer to
  281. reside, and where many public domain programs also expect the mailer
  282. to reside.
  283. .iP OTHER_SMAIL_NAMES
  284. miscellaneous full pathnames under which smail will be installed.
  285. .I /bin/rmail
  286. should be in this list, to trap mail coming in over uucp.
  287. .I /bin/rsmtp
  288. can also be in this list.  When invoked under this name, batched SMTP
  289. commands will be read from standard input, allowing SMTP to be used
  290. over UUCP between cooperating hosts running smail.
  291. .iP NEWALIASES
  292. an alternate pathname for the
  293. .B mkaliases
  294. utility, which processes an alias file for use by an
  295. .I aliasfile
  296. director.  By installing it as
  297. .B newaliases ,
  298. some compatibility can be maintained with the
  299. .B sendmail
  300. utility of the same name.  The primary difference is that the new
  301. version is not set-uid and cannot be safely made so.  Thus, users
  302. which do not have write access to the directory containing the aliases
  303. file cannot use this command.
  304. .iP ALIASES_FILE
  305. the pathname of the primary aliasing file.  This is the file that is
  306. processed by the
  307. .B mkaliases
  308. utility.  It is also the only alias file defined in the default smail
  309. configuration.  To maintain compatibility with
  310. .B sendmail
  311. under 4.2BSD and 4.3BSD, this should be set to ``/usr/lib/aliases''.
  312. However, you may wish to have this file under LIB_DIR with
  313. the other smail configuration files.  This can be done by setting it
  314. simply to ``aliases''.
  315. .NH 2
  316. Building the Smail Program and Utilities
  317. .PP
  318. After EDITME and other compile-time configuration files have been
  319. adjusted (see the section
  320. .B "Configuring Smail for Your System" )
  321. you are ready to start the build.  The first step in building the
  322. smail program and utilities on your machine is to generate all of the
  323. .I Makefile
  324. dependencies.  This step will allow you to modify compile-time
  325. configuration files and header files without worrying about which
  326. compilations will depend on them.  This information will be stored in
  327. the Makefiles that need them.  To generate these dependencies, use the
  328. command:
  329. .DS I
  330. make depend
  331. .DE
  332. at the top of the smail source hierarchy.  This will take a while, so
  333. you may wish to send the standard output and standard error to a file and
  334. put the command in background.  This can be done in the Bourne or Korn
  335. Shell with the command:
  336. .DS I
  337. make depend > mkdep.out 2>&1 &
  338. .DE
  339. In the C-shell, use the command:
  340. .DS I
  341. make depend >& mkdep.out &
  342. .DE
  343. You can watch the progress of the operation with the command:
  344. .DS I
  345. tail -f mkdep.out
  346. .DE
  347. When the dependencies have been built, build all of the executables with
  348. the command:
  349. .DS I
  350. make
  351. .DE
  352. On an Amdahl 5890 this takes two minutes or more depending upon
  353. machine load.  For other machines, this may take between a half hour
  354. and two hours.
  355. .NH 2
  356. Verifying the Smail Program
  357. .PP
  358. It is a good idea to verify that the smail program works before
  359. actually installation it and the utilities around it.  A simple way to
  360. do this is to run some commands.  To start out, try the command:
  361. .DS I
  362. src/smail -bv -v \fIyour-name\fP@\fIlocal-host\fP
  363. .DE
  364. Here
  365. .I your-name
  366. should be your login name on the local host, and
  367. .I local-host
  368. should be a name for the local host.
  369. .LP
  370. This should produce the following output:
  371. .DS I
  372. director user matched user \fIyour-user\fP
  373. \fIyour-user\fP ... deliverable
  374. .DE
  375. .PP
  376. Next, become superuser (\fBroot\fP on most UN*X machines) and try the
  377. command:
  378. .DS I
  379. src/smail -v \fIyour-name\fP
  380. .DE
  381. This should produce output such as:
  382. .DS I
  383. make directory /usr/spool/smail
  384. make directory /usr/spool/smail/input
  385. new spool file is /usr/spool/smail/input/0dMgpi-000089
  386. .DE
  387. Next give a message on standard input such as:
  388. .DS I
  389. Subject: This is a first test of Smail3.1
  390.  
  391. *hi mom, please send money*
  392. \&.
  393. .DE
  394. The dot, on a line by itself, will terminate the message.  Sending an
  395. end of file character will also suffice.  This should produce:
  396. .DS I
  397. make directory /usr/spool/smail/log
  398. write_log:new msg: from \fIyour-user\fP
  399. director user matched user \fIyour-user\fP
  400. transport local uses driver appendfile
  401. write_log:\fIyour-user\fP ... delivered
  402. make directory /usr/spool/smail/msglog
  403. .DE
  404. Note that smail creates any directories that it requires, if they do
  405. not already exist.  You should now have mail.
  406. .PP
  407. If all of this worked, then there is probably nothing seriously wrong
  408. with the smail program itself.
  409. .NH 2
  410. Installing the Programs
  411. .PP
  412. When you are satisfied that the setup appears to be okay, try
  413. installing the programs on your machine by becoming superuser and
  414. executing the command:
  415. .DS I
  416. make install
  417. .DE
  418. This will create any required directories and will copy the binaries
  419. and a small number of data files into their final locations.  The
  420. installation process will create the following:
  421. .iP "Under the LIB_DIR directory"
  422. .B getopt ,
  423. .B pathalias ,
  424. .B makedb ,
  425. .B arpatxt ,
  426. .B mkline ,
  427. .B mksort ,
  428. .B dcasehost ,
  429. .B mkdbm ,
  430. .B mkpath ,
  431. .B mkhpath ,
  432. .B mkuuwho ,
  433. .B pathmerge ,
  434. .B checkerr ,
  435. .B savelog ,
  436. .B getmap ,
  437. .B gleem ,
  438. and
  439. .B unsharmap .
  440. Also copied into the LIB_DIR directory are the files
  441. .I mkpath.awk ,
  442. .I mkuuwho.awk
  443. and
  444. .I mkpath.sed
  445. which are used by some of the above programs, and the file
  446. .I COPYING
  447. which states your rights and responsibilities in further distribution
  448. of the smail programs.
  449. .iP "Under the SMAIL_BIN_DIR directory"
  450. .B uuwho
  451. and
  452. .B mkaliases .
  453. Also, the smail binary is linked to the names
  454. .B smail ,
  455. .B mailq ,
  456. .B pathto ,
  457. .B optto ,
  458. .B uupath ,
  459. .B runq
  460. and
  461. .B rsmtp .
  462. .PP
  463. The smail binary will also be copied to whatever was named in the
  464. .I EDITME
  465. file as the SMAIL_NAME.  Normally, this will be
  466. .I /usr/lib/sendmail .
  467. It will also be copied to any pathnames listed in OTHER_SMAIL_NAMES,
  468. such as
  469. .I /bin/rmail
  470. or
  471. .I /bin/rsmtp .
  472. Also, if you defined a value for NEWALIASES in the
  473. .I EDITME
  474. file, such as
  475. .I /usr/local/bin/newaliases ,
  476. then the
  477. .B mkaliases
  478. program will be copied to that name.
  479. .PP
  480. All of the copies of the smail binary will be owned by root and have
  481. the set-uid bit set.
  482. .B Smail3.1
  483. has been designed so that it does not need to run as root, though this
  484. creates the potential for a a variety of trojan horse attacks which
  485. must be carefully handled through configuration files.  It is
  486. generally easier to install smail as a setuid to root program so that
  487. the potential for trojan horse attacks is more easily managed.
  488. .PP
  489. The current implementation of
  490. .B mkaliases
  491. is a Bourne shell script which cannot be made secure as a setuid
  492. program.  Thus, only users that can write to the directory containing
  493. the aliases file can successfully run this program.  This behavior is
  494. incompatible with the
  495. .B newaliases
  496. program distributed with Berkeley's
  497. .B sendmail
  498. program.  This is expected to change in a future release.
  499. .NH 2
  500. Smail Queue Runs
  501. .PP
  502. When messages block for some reason and smail decides that it would be
  503. best to retry deliver at a later time, messages will be left in the
  504. .I input
  505. spool directory.  In order to reattempt delivery, a smail process must
  506. scan through this directory at intervals looking for work.  This can
  507. either be accomplished by starting up one smail process that scans for
  508. work, sleeps for a set time period, and then scans again, or
  509. .I cron (8)
  510. can be used to start up a process to scan for work.
  511. .PP
  512. To startup a single smail process that scans for work at intervals,
  513. execute the following command from your machine's
  514. .I /etc/rc
  515. file:
  516. .DS I
  517. /usr/lib/sendmail \-q20m
  518. .DE
  519. This will scan for work every twenty minutes.  To scan for work once per
  520. hour use an argument of
  521. .B \-q1h
  522. instead.  This command will automatically put itself in background, so
  523. you do not need to use an ampersand after the command.
  524. .PP
  525. To execute smail periodically from cron, use a line such as:
  526. .DS I
  527. 0,20,40 * * * * /usr/lib/sendmail -q
  528. .DE
  529. Each invocation of smail with this command will perform exactly one
  530. scan through the
  531. .I input
  532. spool directory, which will be done in foreground.
  533. .PP
  534. Systems using the
  535. .B "System V"
  536. cron program can safely put this in the crontab file for
  537. .B root ,
  538. or in any other crontab file.
  539. Sites running the 4.3BSD version of cron can put a line in
  540. .I /usr/lib/crontab
  541. such as:
  542. .DS I
  543. 0,20,40 * * * * root /usr/lib/sendmail -q
  544. .DE
  545. .NH 2
  546. Listening for SMTP Requests
  547. .PP
  548. If your site supports Berkeley networking, then you can use smail to
  549. process interactive SMTP requests.  This can be done either from a
  550. non-exiting smail daemon, or from the 4.3BSD or Sun
  551. .I inet
  552. daemon.  The decision as to whether to use a smail daemon, or the inet
  553. daemon depends upon how much mail passes through your site and whether
  554. or not you can always spare 300K of virtual memory.
  555. .PP
  556. To invoke a smail daemon at system boot time, execute the following
  557. command from
  558. .I /etc/rc :
  559. .DS I
  560. /usr/lib/sendmail \-bd
  561. .DE
  562. This can be combined with the
  563. .B \-q
  564. flag described in the previous section, so executing the command:
  565. .DS I
  566. /usr/lib/sendmail \-bd \-q20m
  567. .DE
  568. will handle listening for SMTP connection requests and the processing
  569. of the
  570. .I input
  571. directory at intervals.
  572. .PP
  573. To invoke smail from the 4.3BSD
  574. .I inetd
  575. program, put the following line in
  576. .I /etc/inetd.conf :
  577. .DS I
  578. smtp    stream    tcp    nowait    root    /usr/local/smtpd smtpd
  579. .DE
  580. If
  581. .I smtpd
  582. was installed in a different directory, use whatever is appropriate in
  583. place of
  584. .I /usr/local/smtpd .
  585. To invoke smail from the SunOS
  586. .I inetd
  587. program, put the following line in
  588. .I /etc/servers :
  589. .DS I
  590. smtp    tcp    /usr/local/smtpd
  591. .DE
  592. .PP
  593. If you have some other form of networking connection that can be used
  594. to create a bi-directional interactive connection, you can use the
  595. .I smtpd
  596. program, or the command
  597. .I "/usr/lib/sendmail -bs"
  598. to receive SMTP requests over that bi-directional connection.
  599. .NH 2
  600. Cleaning Up After Smail
  601. .PP
  602. Smail creates log files.  If log files are not truncated in a
  603. reasonable manner, then they will eventually fill up all available
  604. space.  To handle log file truncation, a shell script,
  605. .I savelog
  606. is provided to cycle a log through a set of files, where no more than
  607. a set number of files are kept.  As an example, the command:
  608. .DS I
  609. /usr/lib/smail/savelog /usr/spool/smail/log/logfile
  610. .DE
  611. will rename the smail log file to
  612. .I /usr/spool/smail/log/OLD/logfile.1 .
  613. If this file already exists, it will be renamed to
  614. .I logfile.2
  615. before the original logfile is renamed, and so on up to
  616. .I logfile.7 .
  617. Whenever
  618. .I logfile.6
  619. is renamed to
  620. .I logfile.7 ,
  621. this last file is simply removed.
  622. .PP
  623. If the
  624. .I compress
  625. program is available, then
  626. .I logfile.2
  627. through
  628. .I logfile.7
  629. are kept in a compressed form with an extension of
  630. .I .Z .
  631. Different compression programs may also be used, generating logfiles
  632. with different extensions.
  633. .PP
  634. Running the above savelog command from cron once per day will thus
  635. keep the last seven days worth of logfile data, much of it in a
  636. compressed form.
  637. .PP
  638. Occasionally, smail will run into a problem that requires the
  639. attention of a mail administrator.  An example of this is an error in
  640. the configuration files.  Rather than continually retrying a message
  641. and continually failing, messages are moved into an
  642. .I error
  643. directory under the spool directory hierarchy.  The utility
  644. .B checkerr
  645. can be called from cron to check up on this directory at intervals,
  646. and send a report on newly failed messages to the address
  647. .B Postmaster .
  648. This script should be run periodically, perhaps once per day, under a
  649. user that can write to the
  650. .I error
  651. spool directory.  Normally, this requires that it run as root, though
  652. the
  653. .I chown (1)
  654. command can be used to assign this directory to an alternate user.
  655.